import 'package:finance_app/src/entities/dashboard_leave_entity.dart';

dashboardLeaveEntityFromJson(DashboardLeaveEntity data, Map<String, dynamic> json) {
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['used'] != null) {
		data.used = json['used'] is String
				? num.tryParse(json['used'])
				: json['used'];
	}
	if (json['total'] != null) {
		data.total = json['total'] is String
				? num.tryParse(json['total'])
				: json['total'];
	}
	return data;
}

Map<String, dynamic> dashboardLeaveEntityToJson(DashboardLeaveEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['name'] = entity.name;
	data['used'] = entity.used;
	data['total'] = entity.total;
	return data;
}